@extends('admin.layout')

@section('content')
    <div class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin" style="padding: 20px 30px 0 0;">
        <form action="{{ route('admin.admin.assignRole',$user) }}">
        <div class="layui-form-item">
            <label for="" class="layui-form-label">角色</label>
            <div class="layui-input-block">
                @forelse($roles as $role)
                    <input type="checkbox" name="roles[]" value="{{$role->id}}" title="{{$role->display_name}}" {{ $role->own ? 'checked' : ''  }} >
                @empty
                    <div class="layui-form-mid layui-word-aux">还没有角色</div>
                @endforelse
            </div>
        </div>
        <div class="layui-form-item layui-hide">
            <input type="button" lay-submit lay-filter="submit" id="submit" value="确认">
        </div>
        </form>
    </div>
@endsection

@section('js')
    <script>
        layui.config({
            base: '/static/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form'], function(){
            var $ = layui.$
                ,form = layui.form ;
        })
    </script>
@endsection
